package Thread;

/**
 * @author liyang
 * @version 1.0
 * @package Thread
 * @file PriorityDemo.java
 * @description
 * @time 2024-04-07 18:29
 */
public class PriorityDemo {
    public static void main(String[] args) {
        Thread min = new Thread(){
            //匿名内部类
            @Override
            public void run(){
                for (int i=0;i<10000;i++){
                    System.out.println("min");
                }

            }

        };

        Thread normal = new Thread(){
            @Override
            public void run(){
                for (int i=0;i<10000;i++){
                    System.out.println("nor");
                }

            }

        };

        Thread max = new Thread(){
            @Override
            public void run(){
                for (int i=0;i<10000;i++){
                    System.out.println("max");
                }

            }

        };
        min.setPriority(1);
        normal.setPriority(5);
        max.setPriority(10);


        min.start();
        normal.start();
        max.start();


    }
}
